Skip to content

Simplify SIMD arg processing. NFC#27193

Merged
sbc100 merged 1 commit into
emscripten-core:mainfrom
sbc100:simplify_simd_arg_processing
Jun 26, 2026
Merged

Simplify SIMD arg processing. NFC#27193
sbc100 merged 1 commit into
emscripten-core:mainfrom
sbc100:simplify_simd_arg_processing

Conversation

@sbc100

@sbc100 sbc100 commented Jun 25, 2026

Copy link
Copy Markdown
Collaborator

No description provided.

@sbc100 sbc100 requested a review from tlively June 25, 2026 19:01
@sbc100 sbc100 force-pushed the simplify_simd_arg_processing branch 2 times, most recently from df4d40c to 9ad5688 Compare June 25, 2026 19:55

@tlively tlively left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Even with the set, this does an awful lot of repeated work. But I guess performance doesn't really matter here?

The more efficient algorithm would be to create the set of user args, then linear search from highest to lowest feature in the feature tower to find the index of the highest enabled feature. Then you can iterate through the cflags up to that index.

Comment thread tools/compile.py Outdated
@kleisauke

Copy link
Copy Markdown
Collaborator

FWIW, this reminds me of that -mno-avx2 doesn't work here, so you'll need to do -U__AVX2__ in the CFLAGS, see for example:
https://github.com/kleisauke/wasm-vips/blob/9ff73c569c91ded6f8d8c7570967d0dadcf0134d/build.sh#L415

Anyway, that could probably be addressed in a follow-up.

@sbc100

sbc100 commented Jun 26, 2026

Copy link
Copy Markdown
Collaborator Author

FWIW, this reminds me of that -mno-avx2 doesn't work here, so you'll need to do -U__AVX2__ in the CFLAGS, see for example: https://github.com/kleisauke/wasm-vips/blob/9ff73c569c91ded6f8d8c7570967d0dadcf0134d/build.sh#L415

Anyway, that could probably be addressed in a follow-up.

Yes, that can be a separate non-NFC change

@sbc100 sbc100 force-pushed the simplify_simd_arg_processing branch from 9ad5688 to 93f112c Compare June 26, 2026 18:04
@sbc100

sbc100 commented Jun 26, 2026

Copy link
Copy Markdown
Collaborator Author

Even with the set, this does an awful lot of repeated work. But I guess performance doesn't really matter here?

The more efficient algorithm would be to create the set of user args, then linear search from highest to lowest feature in the feature tower to find the index of the highest enabled feature. Then you can iterate through the cflags up to that index.

I think this a nice simple cleanup regardless of possible future changes.

@sbc100 sbc100 merged commit dcb09bc into emscripten-core:main Jun 26, 2026
18 of 21 checks passed
@sbc100 sbc100 deleted the simplify_simd_arg_processing branch June 26, 2026 18:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants